-- math.random() generate a series of pseudo-random numbers
-- It means you will get the same sequence of random numbers 
-- in your each program running
-- And the pseudo-random numbers determined by a seed. 
-- Different seed, diffrent sequences.

math.randomseed(os.time()) 	-- set a seed

print("math.random(): [0, 1)")
for i = 1, 8 do
	print("index " .. i .. ": " .. math.random())
end

print("\nmath.random(n): [1, n]")
for i = 1, 8 do
	print("index " .. i .. ": " .. math.random(4))
end

print("\nmath.random(n1, n2): [n1, n2]")
for i = 1, 8 do
	print("index " .. i .. ": " .. math.random(4, 6))
end
